import module from '../../module'

export default name => {
    const root = `${module.code}/${name}/`
    const crud = $http.crud(root)
    // 公司查询
    crud.companyQuery = params => {
        return $http.get('/baseinfo/company/query', params)
    }
    //查询报班列表
    crud.getreportclassbusinfo = params => {
        return $http.get('/dispatch/common/getreportclassbusinfo', params)
    }
    //目的站点查询
    crud.targetInfoQuery = params => {
        return $http.get('/baseinfo/target_info/query', params)
    }
    //查询班次列表
    crud.querybusinfoforselect = params => {
        return $http.get('/dispatch/common/querybusinfoforselect', params)
    }
    //通过车牌号获取车辆详情
    crud.getcarinfo = params => {
        return $http.get('/dispatch/common/getcarinfo', params)
    }
    //查询司机信息
    crud.getonedriver = params => {
        return $http.get('/dispatch/common/getonedriver', params)
    }
    //获取线路
    crud.querylineinfo = params => {
        return $http.get('/dispatch/common/querylineinfo', params)
    }
    //报班
    crud.submitreportclass = params => {
        return $http.post('/dispatch/common/submitreportclass', params)
    }
    //查询报班记录
    crud.getreportclass = params => {
        return $http.get('/dispatch/common/getreportclass', params)
    }
    //报班作废
    crud.canclereportclass = params => {
        return $http.get('/dispatch/common/canclereportclass', params)
    }
    //获取车辆列表
    crud.vehicleInfoQuery = params => {
        return $http.get('/baseinfo/vehicle_info/query', params)
    }
    return {
        ...crud
    }
}
